from enum import Enum, IntEnum, auto


status = 404


match status:
    case 200|404|500:
        print("OK")
    # case 404:
    #     print("Not Found")
    # case 500:
    #     print("Internal Server Error")
    case _:
        print("Unknown Status")

# 枚举

class Status:
    OK = 200
    NOT_FOUND = 404
    INTERNAL_SERVER_ERROR = 500

match status:
    case Status.OK|Status.NOT_FOUND|Status.INTERNAL_SERVER_ERROR:
        print("OK")
    # case Status.NOT_FOUND:
    #     print("Not Found")
    # case Status.INTERNAL_SERVER_ERROR:
    #     print("Internal Server Error")
    case _:
        print("Unknown Status")

p  = (1,2)

match p:
    case (0 as x,y):
        print(x,y)
    case (x,0 as y):
        print(x,y)
    case (1 as x,2 as y):
        print(f"(x,y)={x},{y}")
    case _:
        print("Unknown")

class Point:
    __match_args__ = ('x','y')

    def __init__(self,x,y):
        self.x = x
        self.y = y
    

p1 = Point(2,3)

match p1:
    case Point(x=0,y=0):
        print("原点")
    case Point(x=0,y=y):
        print(f"y={y}")
    case Point(x=x,y=0):
        print(f"x={x}")
    case Point(x=x,y=y) if x==y:
        print(f"(x,y)={x},{y}")
    case Point():
        print("任意点")
    case _:
        print("Unknown")

class Color(Enum):
    RED = 'red'
    GREEN = 'green'
    BLUE = 'blue'


color = Color('green')
# color1 = Color(1)
print(color)

# print(color1)

# class Weekday(IntEnum):
#     MON
#     TUE
#     WED

from enum import IntEnum

